package com.katesoft.scale4j.common.beans;

import com.katesoft.scale4j.common.annotation.ValueObject;
import com.katesoft.scale4j.common.model.IPrettyPrintableObject;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;

/**
 * this is just wrapper for property-value pair. can be re-used effectively.
 *
 * @author kaet2007
 */
@ValueObject
public class PropertyValue<V> implements IPrettyPrintableObject
{
    private final String property;
    private final V value;

    public PropertyValue(final String p_property,
                         final V p_value)
    {
        super();
        this.property = p_property;
        this.value = p_value;
    }

    public String getProperty()
    {
        return property;
    }

    public V getValue()
    {
        return value;
    }

    @Override
    public String reflectionToString()
    {
        return ReflectionToStringBuilder.toString(this);
    }
}
